import { _decorator, Sprite } from 'cc';
import { BaseLayer } from './BaseLayer';
import { DataMgr } from '../manager/DataMgr';
const { ccclass, property } = _decorator;

@ccclass('LoadingLayer')
export class LoadingLayer extends BaseLayer {
    @property(Sprite)
    loading_fill: Sprite = null

    update(deltaTime: number) {
        if (this.loading_fill && this.node.active) {
            this.loading_fill.fillRange = DataMgr.ins.loadingRange
            if (DataMgr.ins.loadingRange >= 0.99) {
                this.hide()
            }
        }
    }
}


